Skip to content

fix(ios): Resolve getNewScreenTimeToDisplay Promise with number not array#6438

Merged
lucas-zimerman merged 4 commits into
mainfrom
antonis/fix/ttid-fallback-nsarray
Jul 13, 2026
Merged

fix(ios): Resolve getNewScreenTimeToDisplay Promise with number not array#6438
lucas-zimerman merged 4 commits into
mainfrom
antonis/fix/ttid-fallback-nsarray

Conversation

@antonis

@antonis antonis commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

  • Retype the block (.h + .m signature + ivar) to RCTPromiseResolveBlock.
  • Resolve with the raw timestamp @(currentTime) instead of @[ @(currentTime) ].
  • Resolve with nil instead of an empty array @[] on the non-iOS (#else) branch.
  • Add a native regression test asserting the resolve value is a scalar NSNumber, never an array.

💡 Motivation and Context

Fixes #6433

💚 How did you test it?

  • Added testGetTimeToDisplayResolvesWithNumberNotArray to RNSentryTimeToDisplayTests.swift. Verified it fails against the previous array-resolving behavior and passes with the fix.
  • Ran the full RNSentryTimeToDisplayTests suite (4/4 pass).
  • Ran the affected JS suites (sentryeventemitterfallback, reactnavigation.ttid, timeToDisplay integration) — 32/32 pass. No JS changes were required; consumers already expect a scalar per the declared Promise<number | undefined | null> type.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

…rray

`getTimeToDisplay:` typed its block as `RCTResponseSenderBlock` (the
callback convention that wraps results in an `NSArray`), but it is only
invoked via the Promise-based `getNewScreenTimeToDisplay` bridge method,
whose `RCTPromiseResolveBlock` expects a raw value. The Promise therefore
resolved with a single-element array instead of a timestamp number. The
array survived the duration arithmetic via coercion but was assigned
directly as the TTID span's `timestamp`, producing a spurious
`deadline_exceeded` status and an inflated duration.

Retype the block to `RCTPromiseResolveBlock` and resolve with the raw
timestamp (and `nil` on non-iOS instead of an empty array). Adds a native
regression test asserting the resolve value is a scalar `NSNumber`.

Fixes #6433

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(ios): Resolve getNewScreenTimeToDisplay Promise with number not array by antonis in #6438
  • chore(deps): bump actions/setup-java from 5.5.0 to 5.6.0 by dependabot in #6476
  • release: 8.19.0 by alwx in b57f2519
  • chore(deps): bump ruby/setup-ruby from 1.316.0 to 1.319.0 by dependabot in #6462
  • chore(deps): update Sentry Android Gradle Plugin to v6.15.0 by github-actions in #6464
  • fix(tracing): Retry expoRouterIntegration navigationRef lookup by alwx in #6451
  • feat(core): Aggregate TurboModule call counts and latency per (module, method, kind) by alwx in #6377
  • chore(deps): bump the codeql-action group with 2 updates by dependabot in #6461
  • fix(core): Fix stale route when reactNavigationIntegration uses a route override provider by alwx in #6458
  • chore(deps): update Android SDK to v8.49.0 by github-actions in #6459
  • feat(android): Add enableHistoricalTombstoneReporting option by Cryptoteep in #6450
  • docs(sdk-versions): Add 8.14.2 row to main by alwx in #6456
  • docs(changelog): Add 8.14.2 changelog entry by alwx in #6455
  • chore(deps): bump ruby/setup-ruby from 1.314.0 to 1.316.0 by dependabot in #6446
  • chore(deps): bump actions/setup-java from 5.3.0 to 5.5.0 by dependabot in #6444
  • chore(deps): bump github/codeql-action/analyze from 4.36.3 to 4.37.0 by dependabot in #6443
  • chore(deps): bump dorny/paths-filter from 4.0.1 to 4.0.2 by dependabot in #6442
  • chore(deps): update JavaScript SDK to v10.65.0 by github-actions in #6441
  • fix(ios): Break RNSentryOnDrawReporterView retain cycle in emit-new-frame block by alwx in #6449
  • refactor(ios): Migrate from PrivateSentrySDKOnly to SentrySDK.internal by alwx in #6380
  • docs: Improve PR template guidance by sentry-junior in #6447
  • fix(ios): Resolve getNewScreenTimeToDisplay Promise with number not array by antonis in #6438
  • fix(feedback): Guard show/hide against uninitialized _setVisibility by antonis in #6435
  • fix(tracing): Fix orphaned TTID/TTFD spans in the trace view by antonis in #6437

Plus 8 more


🤖 This preview updates automatically when you update the PR.

Comment thread CHANGELOG.md Outdated
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jul 10, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c6bc808. Configure here.

@sentry

sentry Bot commented Jul 10, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.18.0 (98) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3822.08 ms 1209.64 ms -2612.44 ms
Size 4.98 MiB 6.53 MiB 1.55 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b9bebee+dirty 3850.15 ms 1227.51 ms -2622.64 ms
3d377b5+dirty 1218.48 ms 1219.51 ms 1.03 ms
1a2e7e0+dirty 3842.49 ms 1220.04 ms -2622.45 ms
e5bb5f6+dirty 3826.14 ms 1212.24 ms -2613.90 ms
6acdf1d+dirty 3844.33 ms 1212.96 ms -2631.38 ms
41d6254+dirty 3845.71 ms 1224.51 ms -2621.20 ms
9210ae6+dirty 3815.93 ms 1214.14 ms -2601.79 ms
c004dae+dirty 3850.32 ms 1227.79 ms -2622.53 ms
4e0b819+dirty 3839.05 ms 1210.75 ms -2628.30 ms
0b5120f+dirty 3838.39 ms 1232.91 ms -2605.48 ms

App size

Revision Plain With Sentry Diff
b9bebee+dirty 5.15 MiB 6.68 MiB 1.53 MiB
3d377b5+dirty 3.38 MiB 4.76 MiB 1.38 MiB
1a2e7e0+dirty 4.98 MiB 6.46 MiB 1.49 MiB
e5bb5f6+dirty 4.98 MiB 6.51 MiB 1.53 MiB
6acdf1d+dirty 4.98 MiB 6.51 MiB 1.53 MiB
41d6254+dirty 5.15 MiB 6.70 MiB 1.54 MiB
9210ae6+dirty 5.15 MiB 6.68 MiB 1.53 MiB
c004dae+dirty 5.15 MiB 6.67 MiB 1.51 MiB
4e0b819+dirty 4.98 MiB 6.46 MiB 1.49 MiB
0b5120f+dirty 5.15 MiB 6.68 MiB 1.53 MiB

Previous results on branch: antonis/fix/ttid-fallback-nsarray

Startup times

Revision Plain With Sentry Diff
ab2b71d+dirty 3847.09 ms 1230.28 ms -2616.80 ms

App size

Revision Plain With Sentry Diff
ab2b71d+dirty 4.98 MiB 6.53 MiB 1.55 MiB

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3859.11 ms 1225.74 ms -2633.37 ms
Size 4.98 MiB 6.53 MiB 1.55 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b0d3373+dirty 3842.49 ms 1218.49 ms -2624.00 ms
ef27341+dirty 3835.20 ms 1212.23 ms -2622.97 ms
e5bb5f6+dirty 3825.74 ms 1217.30 ms -2608.43 ms
44c8b3f+dirty 3849.24 ms 1209.94 ms -2639.31 ms
68672fc+dirty 3832.22 ms 1228.29 ms -2603.93 ms
5748023+dirty 3844.74 ms 1225.49 ms -2619.26 ms
6acdf1d+dirty 3835.35 ms 1218.30 ms -2617.06 ms
2c735cc+dirty 1223.33 ms 1224.38 ms 1.04 ms
100ce80+dirty 3843.57 ms 1226.46 ms -2617.12 ms
9210ae6+dirty 3834.11 ms 1216.64 ms -2617.47 ms

App size

Revision Plain With Sentry Diff
b0d3373+dirty 5.15 MiB 6.68 MiB 1.53 MiB
ef27341+dirty 5.15 MiB 6.68 MiB 1.53 MiB
e5bb5f6+dirty 4.98 MiB 6.51 MiB 1.53 MiB
44c8b3f+dirty 5.15 MiB 6.66 MiB 1.51 MiB
68672fc+dirty 5.15 MiB 6.71 MiB 1.55 MiB
5748023+dirty 5.15 MiB 6.68 MiB 1.53 MiB
6acdf1d+dirty 4.98 MiB 6.51 MiB 1.53 MiB
2c735cc+dirty 3.38 MiB 4.74 MiB 1.35 MiB
100ce80+dirty 5.15 MiB 6.67 MiB 1.51 MiB
9210ae6+dirty 5.15 MiB 6.68 MiB 1.53 MiB

Previous results on branch: antonis/fix/ttid-fallback-nsarray

Startup times

Revision Plain With Sentry Diff
ab2b71d+dirty 3841.31 ms 1213.76 ms -2627.56 ms

App size

Revision Plain With Sentry Diff
ab2b71d+dirty 4.98 MiB 6.53 MiB 1.55 MiB

@antonis
antonis marked this pull request as ready for review July 10, 2026 10:58

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Resolve getNewScreenTimeToDisplay Promise with number not array ([#6438](https://github.com/getsentry/sentry-react-native/pull/6438))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against f664930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

3 participants